<template>
	<div id="test_body">
		<div id="test_btn">點我 觸發測試</div>
		<div id="test_btn2">點我 觸發測試2</div>
	</div>
</template>

<script setup>
import { onMounted } from 'vue';
onMounted(() => {
	let terEle = document.getElementById('test_btn');
	let terEle2 = document.getElementById('test_btn2');

	let MyEventCons = new CustomEvent('build', { detail: '用來測試是否包含 原event 屬性' });

	terEle.addEventListener('click', () => {
		console.log("dianwol");
		terEle2.dispatchEvent(MyEventCons);
	});

	terEle2.addEventListener('build', e => {
		console.log(e);
	});
});
</script>

<style lang="scss">
#test_body {
}

#test_btn {
	width: 80px;
	height: 40px;

	position: absolute;

	transform: translate(400px, 400px);

	background-color: rgba($color: #663275, $alpha: 0.6);
}
</style>
